home *** CD-ROM | disk | FTP | other *** search
/ PC Home 109 / PC Home 109.iso / data1.cab / Program_Files / quiz.dxr / 00019.ls < prev    next >
Encoding:
Text File  |  2001-03-02  |  1.4 KB  |  49 lines

  1. global gQuestion, gCorrectSprite, gQuestionDone, gQuestionCorrect, QuestionList, CorrectAnswers, gBox1Enabled, gBox2Enabled, gBox3Enabled, gBox4Enabled
  2.  
  3. on exitFrame
  4.   handcursor(3)
  5.   repeat with n = 9 to 12
  6.     handcursor(n)
  7.   end repeat
  8.   if gQuestion = 1 then
  9.     set gBox1Enabled to 1
  10.     set gBox2Enabled to 1
  11.     set gBox3Enabled to 1
  12.     set gBox4Enabled to 1
  13.     set QuestionList to GetRandomListOfTen(27)
  14.     set CorrectAnswers to 0
  15.     set n to getAt(QuestionList, gQuestion)
  16.     set gCorrectSprite to SetQuestionNextlevel(n)
  17.     set gQuestionCorrect to 1
  18.     set gQuestionDone to 0
  19.     set gQuestion to 2
  20.   end if
  21.   if gQuestionDone then
  22.     if gQuestionCorrect then
  23.       set CorrectAnswers to CorrectAnswers + 1
  24.     end if
  25.     set gBox1Enabled to 1
  26.     set gBox2Enabled to 1
  27.     set gBox3Enabled to 1
  28.     set gBox4Enabled to 1
  29.     if gQuestion = 11 then
  30.       put CorrectAnswers
  31.       addScoreToList(10, "nextlevel", CorrectAnswers, the text of field "name")
  32.       cursorOff()
  33.       go("scores3")
  34.     else
  35.       set n to getAt(QuestionList, gQuestion)
  36.       set gCorrectSprite to SetQuestionNextlevel(n)
  37.       set gQuestionCorrect to 1
  38.       set gQuestionDone to 0
  39.       set the memberNum of sprite 9 to 20
  40.       set the memberNum of sprite 10 to 21
  41.       set the memberNum of sprite 11 to 22
  42.       set the memberNum of sprite 12 to 23
  43.       set gQuestion to gQuestion + 1
  44.       put gQuestion
  45.     end if
  46.   end if
  47.   go(the frame)
  48. end
  49.